home *** CD-ROM | disk | FTP | other *** search
/ Corel Professional Photo…: American National Parks / Corel Professional Photos - 1994 - 038 - American National Parks.ISO / utils / setup / corelcd.mst_1 < prev    next >
Text File  |  1993-07-15  |  22KB  |  768 lines

  1. '**************************************************************************
  2. '*           MSSetup Toolkit - Corel Professional Photos Setup            *
  3. '**************************************************************************
  4.  
  5. '$DEFINE DEBUG  ''Define for script development/debugging
  6.  
  7. '$INCLUDE 'setupapi.inc'
  8. '$INCLUDE 'msdetect.inc'
  9.  
  10. CONST WS_VISIBLE=&H10000000
  11. CONST WS_BORDER =&H00800000
  12. CONST WS_CLIPCHILDREN =&H02000000
  13. CONST GWL_STYLE =-16
  14. CONST SW_SHOWMAXIMIZED=3
  15.  
  16. DECLARE FUNCTION ShowWindow LIB "user.exe" (hWnd%,iShow%) AS INTEGER
  17. DECLARE FUNCTION SetWindowLong LIB "user.exe" (hWnd%,offset%,style&) AS LONG
  18.  
  19. hWnd%=HwndFrame()
  20.  
  21. sti&=SetWindowLong(hWnd%,GWL_STYLE,WS_VISIBLE+WS_BORDER+WS_CLIPCHILDREN)
  22. stj%=ShowWindow(hWnd%,SW_SHOWMAXIMIZED)
  23.  
  24. ''Dialog ID's
  25. CONST WELCOME      = 100
  26. CONST ASKQUIT      = 200
  27. CONST DESTPATH     = 300
  28. CONST EXITFAILURE  = 400
  29. CONST EXITQUIT     = 600
  30. CONST EXITSUCCESS  = 700
  31. CONST APPHELP      = 900
  32. CONST CUSTINST     = 6200
  33. CONST TOOBIG       = 6300
  34. CONST BADPATH      = 6400
  35. CONST MOSAIC       = 7100
  36. CONST PCDSCSI      = 7200
  37. CONST CDAUDIO      = 7300
  38.  
  39. ''Bitmap ID
  40. CONST LOGO         = 1
  41.  
  42. ''File Types
  43. CONST PCDLABFILES    = 1
  44. CONST PCDMOSFILES    = 2
  45. CONST PCDAUDFILES    = 3
  46. CONST PCDSCRFILES    = 4
  47. CONST PCDWALFILES    = 5
  48.  
  49. FLAG1$          ="No"      '' Copy flags for
  50. FLAG2$          ="No"      '' DLL files that go
  51. FLAG3$          ="No"      '' into WindowsDir and WindowsSysDir
  52.  
  53.  
  54. GLOBAL DEST$        ''Default destination directory.
  55. GLOBAL WINDRIVE$    ''Windows drive letter.
  56. GLOBAL OPT1OPT$     ''Option selection from OptFiles1 option dialog.
  57. GLOBAL OPT2OPT$     ''Option selection from OptFiles2 option dialog.
  58. GLOBAL OPT3OPT$     ''Option selection from OptFiles3 option dialog.
  59. GLOBAL OPT4OPT$     ''Option selection from OptFiles4 option dialog.
  60. GLOBAL MosDir$      ''Location of old mosaic program, if found.
  61.  
  62. ''CustInst list symbol names
  63. GLOBAL PCDLABNEEDS$    ''Option list costs per drive
  64. GLOBAL PCDMOSNEEDS$
  65. GLOBAL PCDAUDNEEDS$
  66. GLOBAL PCDSCRNEEDS$
  67. GLOBAL PCDWALNEEDS$
  68.  
  69. GLOBAL EXTRACOSTS$  ''List of extra costs to add per drive
  70. GLOBAL BIGLIST$     ''List of option files cost calc results (boolean)
  71.  
  72. ''Dialog list symbol names
  73. GLOBAL CHECKSTATES$
  74. GLOBAL STATUSTEXT$
  75. GLOBAL DRIVETEXT$
  76.  
  77.  
  78. DECLARE SUB AddOptFilesToCopyList (ftype%)
  79. DECLARE SUB RecalcOptFiles (ftype%)
  80. DECLARE SUB RecalcPath
  81. DECLARE SUB SetDriveStatus
  82. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  83.  
  84.  
  85.  
  86. INIT:
  87.     CUIDLL$ = "mscuistf.dll"            ''custom user interface dll
  88.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  89.  
  90.     SetBitmap CUIDLL$, LOGO
  91.     SetTitle "Corel Professional Photos Setup"
  92.  
  93.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  94.     IF szInf$ = "" THEN
  95.     szInf$ = GetSymbolValue("STF_CWDDIR") + "CORELCD.INF"
  96.     END IF
  97.     ReadInfFile szInf$
  98.  
  99.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  100.     WINDIR$ = GetWindowsDir()
  101.     DEST$ = WINDRIVE$ + ":\CORELCD"
  102.  
  103.     ''CustInst list symbols
  104.     CHECKSTATES$ = "CheckItemsState"
  105.     STATUSTEXT$  = "StatusItemsText"
  106.     DRIVETEXT$   = "DriveStatusText"
  107.     FOR i% = 1 TO 8 STEP 1
  108.     AddListItem CHECKSTATES$, "ON"
  109.     NEXT i%
  110.     FOR i% = 1 TO 8 STEP 1
  111.     AddListItem STATUSTEXT$, ""
  112.     NEXT i%
  113.     FOR i% = 1 TO 7 STEP 1
  114.     AddListItem DRIVETEXT$, ""
  115.     NEXT i%
  116.     ReplaceListItem DRIVETEXT$, 7, DEST$
  117.  
  118.     ''Disk cost list symbols
  119.     PCDLABNEEDS$  = "PcdLabNeeds"
  120.     PCDMOSNEEDS$  = "PcdMosNeeds"
  121.     PCDAUDNEEDS$  = "PcdAudNeeds"
  122.     PCDSCRNEEDS$  = "PcdScrNeeds"
  123.     PCDWALNEEDS$  = "PcdWalNeeds"
  124.     EXTRACOSTS$ = "ExtraCosts"
  125.     BIGLIST$    = "BigList"
  126.     FOR i% = 1 TO 5 STEP 1
  127.     AddListItem BIGLIST$, ""
  128.     NEXT i%
  129.     FOR i% = 1 TO 26 STEP 1
  130.     AddListItem EXTRACOSTS$, "0"
  131.     NEXT i%
  132.  
  133.     ''File Option Variables
  134.     OPT1OPT$ = "1"
  135.     OPT2OPT$ = "1"
  136.     OPT3OPT$ = "1"
  137.     OPT4OPT$ = "1"
  138.  
  139.     RecalcPath
  140.     SetDriveStatus
  141.  
  142. '$IFDEF DEBUG
  143.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  144. '$ENDIF ''DEBUG
  145.  
  146.  
  147. WELCOME:
  148.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  149.     IF sz$ = "CONTINUE" THEN
  150.     UIPop 1
  151.     ELSE
  152.     GOSUB ASKQUIT
  153.     GOTO WELCOME
  154.     END IF
  155.  
  156.  
  157. CUSTINST:
  158.     sz$ = UIStartDlg(CUIDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
  159.  
  160.     IF sz$ = "CONTINUE" THEN
  161.     ''Install only if it will fit.
  162.     FOR i% = 1 TO 5 STEP 1
  163.         IF GetListItem(BIGLIST$, i%) <> "" THEN
  164.         GOSUB TOOBIG
  165.         GOTO CUSTINST
  166.         END IF
  167.     NEXT i%
  168.     UIPop 1
  169.     GOTO INSTALL
  170.     ELSEIF sz$ = "PATH" THEN
  171.     GOTO GETPATH
  172.     ELSEIF sz$ = "CHK1" THEN
  173.     RecalcOptFiles PCDLABFILES
  174.     SetDriveStatus
  175.     GOTO CUSTINST
  176.     ELSEIF sz$ = "CHK2" THEN
  177.     RecalcOptFiles PCDMOSFILES
  178.     SetDriveStatus
  179.     GOTO CUSTINST
  180.     ELSEIF sz$ = "CHK3" THEN
  181.     RecalcOptFiles PCDAUDFILES
  182.     SetDriveStatus
  183.     GOTO CUSTINST
  184.     ELSEIF sz$ = "CHK4" THEN
  185.     RecalcOptFiles PCDSCRFILES
  186.     SetDriveStatus
  187.     GOTO CUSTINST
  188.     ELSEIF sz$ = "CHK5" THEN
  189.     RecalcOptFiles PCDWALFILES
  190.     SetDriveStatus
  191.     GOTO CUSTINST
  192.     ELSEIF sz$ = "BTN2" THEN
  193.     GOTO PCDMOSFILES
  194.     ELSEIF sz$ = "BTN3" THEN
  195.     GOTO PCDAUDFILES
  196.     ELSEIF sz$ = "BTN4" THEN
  197.     GOTO PCDSCRFILES
  198.     ELSEIF sz$ = "BTN5" THEN
  199.     GOTO PCDWALFILES
  200.     ELSEIF sz$ = "REACTIVATE" THEN
  201.     RecalcPath
  202.     SetDriveStatus
  203.     GOTO CUSTINST
  204.     ELSE
  205.     GOSUB ASKQUIT
  206.     GOTO CUSTINST
  207.     END IF
  208.  
  209.  
  210.  
  211. INSTALL:
  212.     ClearCopyList
  213.     AddOptFilesToCopyList PCDLABFILES
  214.     AddOptFilesToCopyList PCDMOSFILES
  215.     AddOptFilesToCopyList PCDAUDFILES
  216.     AddOptFilesToCopyList PCDSCRFILES
  217.     AddOptFilesToCopyList PCDWALFILES
  218.     CreateDir DEST$, cmoNone
  219.     
  220.     IF GetListItem(CHECKSTATES$, PCDLABFILES) = "ON" THEN
  221.      IF DoesIniKeyExist("WIN.INI", "PhotoCD Lab", "Dir") = 1 THEN
  222.          PcdDir$ = GetIniKeyString("WIN.INI", "PhotoCD Lab", "Dir")
  223.          IF DoesFileExist(PcdDir$ + "\PCDSCSI.EXE", femReadWrite) = 1 THEN
  224.          SetSymbolValue "ConfirmTextIn", PcdDir$
  225.          SetSymbolValue "EditFocus", "END"
  226.          sz$ = UIStartDlg(CUIDLL$, PCDSCSI, "FConfirmDlgProc", APPHELP, HELPPROC$)
  227.          IF sz$ = "BACK" THEN
  228.              UIPop 1
  229.              GOTO CUSTINST
  230.          ELSEIF sz$ = "CONTINUE" THEN
  231.              UIPop 1
  232.          END IF
  233.          END IF
  234.      END IF
  235.      IF PcdDir$ <> "" THEN
  236.          CreateIniKeyValue "WIN.INI", "PhotoCD Lab", "Dir", PcdDir$, cmoOverwrite
  237.      ELSE
  238.          CreateIniKeyValue "WIN.INI", "PhotoCD Lab", "Dir", DEST$ + "\PCDLAB", cmoOverwrite
  239.      END IF
  240.     END IF
  241.  
  242.      IF GetListItem(CHECKSTATES$, PCDMOSFILES) = "ON" THEN
  243.      IF MosDir$ <> "" THEN
  244.          SetSymbolValue "ConfirmTextIn", MosDir$
  245.          SetSymbolValue "EditFocus", "END"
  246.          sz$ = UIStartDlg(CUIDLL$, MOSAIC, "FConfirmDlgProc", APPHELP, HELPPROC$)
  247.          IF sz$ = "BACK" THEN
  248.              UIPop 1
  249.              GOTO CUSTINST
  250.          ELSEIF sz$ = "CONTINUE" THEN
  251.              UIPop 1
  252.          END IF
  253.      END IF    
  254.      IF MosDir$ = "" THEN    
  255.          CreateIniKeyValue "WIN.INI", "CorelGraphics4", "Dir", DEST$ + "\MOSAIC\CONFIG", cmoOverwrite
  256.          CreateDir DEST$ + "\MOSAIC\CONFIG", cmoNone
  257.          CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "ProgramsDir", DEST$ + "\MOSAIC\PROGRAMS", cmoOverwrite
  258.          CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "CustomDir", DEST$ + "\MOSAIC\CUSTOM", cmoOverwrite
  259.          CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "MosaicDir", DEST$ + "\MOSAIC\PROGRAMS", cmoOverwrite
  260.          CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELAPP.INI", "Config", "FiltersDir", DEST$ + "\MOSAIC\PROGRAMS", cmoOverwrite
  261.      END IF
  262.      END IF
  263.     
  264.     IF GetListItem(CHECKSTATES$, PCDAUDFILES) = "ON" THEN
  265.      IF DoesIniKeyExist("WIN.INI", "CorelSCSI", "CD-Audio") = 1 THEN
  266.          CDAudioDir$ = GetIniKeyString("WIN.INI", "CorelSCSI", "CD-Audio")
  267.          IF DoesFileExist(CDAudioDir$ + "\CD_AUDIO.EXE", femReadWrite) = 1 THEN
  268.          SetSymbolValue "ConfirmTextIn", CDAudioDir$
  269.          SetSymbolValue "EditFocus", "END"
  270.          sz$ = UIStartDlg(CUIDLL$, CDAUDIO, "FConfirmDlgProc", APPHELP, HELPPROC$)
  271.          IF sz$ = "BACK" THEN
  272.              UIPop 1
  273.              GOTO CUSTINST
  274.          ELSEIF sz$ = "CONTINUE" THEN
  275.              UIPop 1
  276.          END IF
  277.          END IF
  278.      END IF
  279.      CreateIniKeyValue "WIN.INI", "CorelSCSI", "CD-Audio", DEST$ + "\PCDAUDIO", cmoOverwrite
  280.     END IF
  281.  
  282.     
  283.     CopyFilesInCopyList
  284.  
  285.     InstDrive$=MID$(DEST$,1,2)
  286.     IF GetListItem(CHECKSTATES$, PCDLABFILES) = "ON" THEN
  287.     CreateProgmanGroup "Corel CD-ROM Utilities", "", cmoNone
  288.     ShowProgmanGroup  "Corel Cd-ROM Utilities", 1, cmoNone
  289.     CreateProgmanItem "Corel CD-ROM Utilities", "PhotoCD Lab", MakePath(DEST$, "pcdlab\pcdscsi.exe "), "", cmoOverwrite
  290.     END IF
  291.  
  292.     IF GetListItem(CHECKSTATES$, PCDMOSFILES) = "ON" THEN
  293.     ShowProgmanGroup  "Corel CD-ROM Utilities", 1, cmoNone
  294.     IF MosDir$ <> "" THEN
  295.         CreateProgmanItem "Corel CD-ROM Utilities", "Corel Mosaic", MosDir$ + "\CORELMOS.EXE", "", cmoOverwrite
  296.     ELSE
  297.         CreateProgmanItem "Corel CD-ROM Utilities", "Corel Mosaic", MakePath(DEST$, "mosaic\programs\corelmos.exe "), "", cmoOverwrite
  298.         CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELFLT.INI", "ColorPath", "CircuitPath", DEST$ + "\MOSAIC\CUSTOM", cmoOverwrite
  299.         CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELFLT.INI", "ColorPath", "CurvePath", DEST$ + "\MOSAIC\CUSTOM", cmoOverwrite
  300.         CreateIniKeyValue DEST$ + "\MOSAIC\CONFIG\CORELPRN.INI", "ColorPath", "CircuitPath", DEST$ + "\MOSAIC\CUSTOM", cmoOverwrite
  301.     END IF
  302.     END IF
  303.  
  304.     IF GetListItem(CHECKSTATES$, PCDAUDFILES) = "ON" THEN
  305.     ShowProgmanGroup  "Corel CD-ROM Utilities", 1, cmoNone
  306.     CreateProgmanItem "Corel CD-ROM Utilities", "CD Audio", MakePath(DEST$, "pcdaudio\cd_audio.exe "), "", cmoOverwrite
  307.     END IF
  308.  
  309.     IF GetListItem(CHECKSTATES$, PCDSCRFILES) = "ON" THEN
  310.     ShowProgmanGroup  "Corel CD-ROM Utilities", 1, cmoNone
  311.     END IF
  312.  
  313.     IF GetListItem(CHECKSTATES$, PCDWALFILES) = "ON" THEN
  314.     ShowProgmanGroup  "Corel CD-ROM Utilities", 1, cmoNone
  315.     CreateProgmanItem "Corel CD-ROM Utilities", "Wallpaper Flipper Configuration", MakePath(GetWindowsDir, "wflipcnf.exe"), "", cmoOverwrite
  316.     END IF
  317.  
  318.     CreateProgmanItem "Corel CD-ROM Utilities", "Professional Photos ReadMe", "notepad.exe "+MakePath(DEST$,"readme.txt"), "", cmoOverwrite 
  319.  
  320. QUIT:
  321.     ON ERROR GOTO ERRQUIT
  322.  
  323.     IF ERR = 0 THEN
  324.     dlg% = EXITSUCCESS
  325.     ELSEIF ERR = STFQUIT THEN
  326.     dlg% = EXITQUIT
  327.     ELSE
  328.     dlg% = EXITFAILURE
  329.     END IF
  330. QUITL1:
  331.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  332.     IF sz$ = "REACTIVATE" THEN
  333.     GOTO QUITL1
  334.     END IF
  335.     UIPop 1
  336.  
  337.     END
  338.  
  339. ERRQUIT:
  340.     i% = DoMsgBox("Setup sources were corrupted, call Corel Tech Support", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  341.     END
  342.  
  343.  
  344.  
  345. GETPATH:
  346.     SetSymbolValue "EditTextIn", DEST$
  347.     SetSymbolValue "EditFocus", "END"
  348. GETPATHL1:
  349.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  350.  
  351.     IF sz$ = "CONTINUE" THEN
  352.     olddest$ = DEST$
  353.     DEST$ = GetSymbolValue("EditTextOut")
  354.  
  355.     ''Validate new path.
  356.     IF IsDirWritable(DEST$) = 0 THEN
  357.         GOSUB BADPATH
  358.         GOTO GETPATHL1
  359.     END IF
  360.     UIPop 1
  361.  
  362.     ''Truncate display if too long.
  363.     IF LEN(DEST$) > 23 THEN
  364.         ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..."
  365.     ELSE
  366.         ReplaceListItem DRIVETEXT$, 7, DEST$
  367.     END IF
  368.  
  369.     ''Recalc if path changed.
  370.     IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
  371.         RecalcPath
  372.         SetDriveStatus
  373.     END IF
  374.  
  375.     olddest$ = ""
  376.     GOTO CUSTINST
  377.     ELSEIF sz$ = "REACTIVATE" THEN
  378.     RecalcPath
  379.     SetDriveStatus
  380.     GOTO GETPATHL1
  381.     ELSEIF sz$ = "EXIT" THEN
  382.     GOSUB ASKQUIT
  383.     GOTO GETPATHL1
  384.     ELSE
  385.     UIPop 1
  386.     GOTO CUSTINST
  387.     END IF
  388.  
  389.  
  390.  
  391. PCDMOSFILES:
  392.     SetSymbolValue "RadioDefault", OPT1OPT$
  393. OPT1L1:
  394.     sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
  395.     newopt$ = GetSymbolValue("ButtonChecked")
  396.  
  397.     IF sz$ = "CONTINUE" THEN
  398.     UIPop 1
  399.     IF newopt$ <> OPT1OPT$ THEN
  400.         OPT1OPT$ = newopt$
  401.         RecalcOptFiles PCDMOSFILES
  402.         SetDriveStatus
  403.     END IF
  404.     newopt$ = ""
  405.     GOTO CUSTINST
  406.     ELSEIF sz$ = "REACTIVATE" THEN
  407.     RecalcPath
  408.     SetDriveStatus
  409.     GOTO OPT1L1
  410.     ELSEIF sz$ = "EXIT" THEN
  411.     GOSUB ASKQUIT
  412.     GOTO OPT1L1
  413.     ELSE
  414.     UIPop 1
  415.     newopt$ = ""
  416.     GOTO CUSTINST
  417.     END IF
  418.  
  419.  
  420.  
  421. PCDAUDFILES:
  422.     SetSymbolValue "RadioDefault", OPT2OPT$
  423. OPT2L1:
  424.     sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
  425.     newopt$ = GetSymbolValue("ButtonChecked")
  426.  
  427.     IF sz$ = "CONTINUE" THEN
  428.     UIPop 1
  429.     IF newopt$ <> OPT2OPT$ THEN
  430.         OPT2OPT$ = newopt$
  431.         RecalcOptFiles PCDAUDFILES
  432.         SetDriveStatus
  433.     END IF
  434.     newopt$ = ""
  435.     GOTO CUSTINST
  436.     ELSEIF sz$ = "REACTIVATE" THEN
  437.     RecalcPath
  438.     SetDriveStatus
  439.     GOTO OPT2L1
  440.     ELSEIF sz$ = "EXIT" THEN
  441.     GOSUB ASKQUIT
  442.     GOTO OPT2L1
  443.     ELSE
  444.     UIPop 1
  445.     newopt$ = ""
  446.     GOTO CUSTINST
  447.     END IF
  448.  
  449.  
  450.  
  451. PCDSCRFILES:
  452.     SetSymbolValue "RadioDefault", OPT3OPT$
  453. OPT3L1:
  454.     sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
  455.     newopt$ = GetSymbolValue("ButtonChecked")
  456.  
  457.     IF sz$ = "CONTINUE" THEN
  458.     UIPop 1
  459.     IF newopt$ <> OPT1OPT$ THEN
  460.         OPT3OPT$ = newopt$
  461.         RecalcOptFiles PCDSCRFILES
  462.         SetDriveStatus
  463.     END IF
  464.     newopt$ = ""
  465.     GOTO CUSTINST
  466.     ELSEIF sz$ = "REACTIVATE" THEN
  467.     RecalcPath
  468.     SetDriveStatus
  469.     GOTO OPT3L1
  470.     ELSEIF sz$ = "EXIT" THEN
  471.     GOSUB ASKQUIT
  472.     GOTO OPT3L1
  473.     ELSE
  474.     UIPop 1
  475.     newopt$ = ""
  476.     GOTO CUSTINST
  477.     END IF
  478.  
  479.  
  480.  
  481. PCDWALFILES:
  482.     SetSymbolValue "RadioDefault", OPT4OPT$
  483. OPT4L1:
  484.     sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
  485.     newopt$ = GetSymbolValue("ButtonChecked")
  486.  
  487.     IF sz$ = "CONTINUE" THEN
  488.     UIPop 1
  489.     IF newopt$ <> OPT4OPT$ THEN
  490.         OPT4OPT$ = newopt$
  491.         RecalcOptFiles PCDWALFILES
  492.         SetDriveStatus
  493.     END IF
  494.     newopt$ = ""
  495.     GOTO CUSTINST
  496.     ELSEIF sz$ = "REACTIVATE" THEN
  497.     RecalcPath
  498.     SetDriveStatus
  499.     GOTO OPT4L1
  500.     ELSEIF sz$ = "EXIT" THEN
  501.     GOSUB ASKQUIT
  502.     GOTO OPT4L1
  503.     ELSE
  504.     UIPop 1
  505.     newopt$ = ""
  506.     GOTO CUSTINST
  507.     END IF
  508.  
  509.  
  510.  
  511. TOOBIG:
  512.     sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  513.     IF sz$ = "REACTIVATE" THEN
  514.     RecalcPath
  515.     SetDriveStatus
  516.     GOTO TOOBIG
  517.     END IF
  518.     UIPop 1
  519.     RETURN
  520.  
  521.  
  522.  
  523. BADPATH:
  524.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  525.     IF sz$ = "REACTIVATE" THEN
  526.     RecalcPath
  527.     SetDriveStatus
  528.     GOTO BADPATH
  529.     END IF
  530.     UIPop 1
  531.     RETURN
  532.  
  533.  
  534.  
  535. ASKQUIT:
  536.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  537.  
  538.     IF sz$ = "EXIT" THEN
  539.     UIPopAll
  540.     ERROR STFQUIT
  541.     ELSEIF sz$ = "REACTIVATE" THEN
  542.     GOTO ASKQUIT
  543.     ELSE
  544.     UIPop 1
  545.     END IF
  546.     RETURN
  547.  
  548.  
  549.  
  550. '**
  551. '** Purpose:
  552. '**     Adds the specified option files to the copy list.
  553. '** Arguments:
  554. '**     ftype%  - type of files to add, one of the following:
  555. '**             PCDLABFILES, PCDAUDFILES, PCDMOSFILES, PCDSCRFILES, PCDWALFILES
  556. '** Returns:
  557. '**     none.
  558. '*************************************************************************
  559. SUB AddOptFilesToCopyList (ftype%) STATIC
  560.  
  561.     IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
  562.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  563.     WinDirLen = LEN(GetWindowsDir)-1
  564.     WinDir$ = MID$(GetWindowsDir,1,WinDirLen)
  565.     InstDrive$ = MID$(DEST$,1,2)
  566.     IF ftype% = PCDLABFILES THEN
  567.         AddSectionFilesToCopyList "PcdLabFiles", SrcDir$, DEST$ + "\PCDLAB"
  568.         FLAG1$="Yes"
  569.         FLAG2$="Yes"
  570.         FLAG3$="Yes"
  571.     ELSEIF ftype% = PCDMOSFILES THEN
  572.      IF DoesIniKeyExist("WIN.INI", "CorelGraphics4", "Dir") = 1 THEN
  573.          CorelAppDir$ = GetIniKeyString("WIN.INI", "CorelGraphics4", "Dir")
  574.          MosDir$ = GetIniKeyString(CorelAppDir$ + "\CORELAPP.INI", "Config", "MosaicDir")
  575.          IF DoesFileExist(MosDir$ + "\CORELMOS.EXE", femReadWrite) = 1 THEN
  576.            MosFlag$ = "Yes"
  577.            AddSectionFilesToCopyList "PcdMosFiles", SrcDir$, MosDir$
  578.            AddSectionFilesToCopyList "PcdMosUtils", SrcDir$, MosDir$
  579.          END IF 
  580.      ELSE 
  581.           AddSectionFilesToCopyList "PcdMosFiles", SrcDir$, DEST$ + "\MOSAIC\PROGRAMS"
  582.           AddSectionFilesToCopyList "PcdMosUtils", SrcDir$, DEST$ + "\MOSAIC\CUSTOM"
  583.           AddSectionFilesToCopyList "PcdMosInis", SrcDir$, DEST$ + "\MOSAIC\CONFIG"
  584.      END IF
  585.         FLAG1$="Yes"
  586.         FLAG3$="Yes"
  587.     ELSEIF ftype% = PCDAUDFILES THEN
  588.         AddSectionFilesToCopyList "PcdAudFiles", SrcDir$, DEST$ + "\PCDAUDIO"
  589.     ELSEIF ftype% = PCDSCRFILES THEN
  590.         AddSectionFilesToCopyList "PcdScrFiles", SrcDir$, GetWindowsDir
  591.         FLAG3$="Yes"
  592.     ELSEIF ftype% = PCDWALFILES THEN
  593.         AddSectionFilesToCopyList "PcdWalFiles", SrcDir$, GetWindowsDir
  594.     END IF
  595.     IF FLAG1$="Yes" THEN
  596.         CreateIniKeyValue "WIN.INI", "Extensions", "PCD", DEST$ + "\PCDLAB\PCDSCSI.EXE ^.PCD", cmoNone
  597.         AddSectionFilesToCopyList "PcdDllFiles", SrcDir$, GetWindowsSysDir
  598.         IF DoesFileExist(GetWindowsDir + "PCDLIB.DLL", femReadWrite) =1 THEN
  599.         RemoveFile GetWindowsDir + "PCDLIB.DLL", cmoNone
  600.         END IF
  601.         IF DoesFileExist(GetWindowsDir + "PCDXTIF.DLL", femReadWrite) =1 THEN
  602.         RemoveFile GetWindowsDir + "PCDXTIF.DLL", cmoNone
  603.         END IF
  604.         IF DoesFileExist(GetWindowsDir + "PCDXEPS.DLL", femReadWrite) =1 THEN
  605.         RemoveFile GetWindowsDir + "PCDXEPS.DLL", cmoNone
  606.         END IF
  607.         IF DoesFileExist(GetWindowsDir + "PCDXPCX.DLL", femReadWrite) =1 THEN
  608.         RemoveFile GetWindowsDir + "PCDXPCX.DLL", cmoNone
  609.         END IF
  610.         IF DoesFileExist(GetWindowsDir + "PCDXBMP.DLL", femReadWrite) =1 THEN
  611.         RemoveFile GetWindowsDir + "PCDXBMP.DLL", cmoNone
  612.         END IF
  613.     END IF
  614.     IF FLAG2$="Yes" THEN
  615.         AddSectionFilesToCopyList "PcdCtlFile", SrcDir$, GetWindowsSysDir
  616.     END IF
  617.     IF FLAG3$="Yes" THEN
  618.         AddSectionFilesToCopyList "PcdDllFile", SrcDir$, GetWindowsSysDir
  619.     END IF
  620.         AddSectionFilesToCopyList "PcdReadMe", SrcDir$, DEST$
  621.     FLAG1$="No"
  622.     FLAG2$="No"
  623.     FLAG3$="No"
  624.     SrcDir$ = ""
  625.     END IF
  626. END SUB
  627.  
  628. '**
  629. '** Purpose:
  630. '**     Recalculates disk space for the given option files and sets
  631. '**     the status info symbol "StatusItemsText".
  632. '** Arguments:
  633. '**     ftype% - type of files to add, one of the following:
  634. '**             PCDLABFILES, PCDMOSFILES, PCDAUDFILES, PCDSCRFILES, PCDWALFILES
  635. '** Returns:
  636. '**     none.
  637. '*************************************************************************
  638. SUB RecalcOptFiles (ftype%) STATIC
  639.     CursorSave% = ShowWaitCursor()
  640.     ClearCopyList
  641.     AddOptFilesToCopyList ftype%
  642.  
  643.     fExtra% = 0
  644.     IF ftype% = PCDLABFILES THEN
  645.     ListSym$ = PCDLABNEEDS$
  646.        IF GetListItem(CHECKSTATES$, PCDLABFILES) = "ON" THEN
  647.        ''Add extra cost to Windows drive for ini/progman, etc.
  648.        ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  649.        ReplaceListItem EXTRACOSTS$, ndrive%, "0"
  650.        fExtra% = 1
  651.        END IF
  652.     ELSEIF ftype% = PCDMOSFILES THEN
  653.     ListSym$ = PCDMOSNEEDS$
  654.     ELSEIF ftype% = PCDAUDFILES THEN
  655.     ListSym$ = PCDAUDNEEDS$
  656.     ELSEIF ftype% = PCDSCRFILES THEN
  657.     ListSym$ = PCDSCRNEEDS$
  658.     ELSEIF ftype% = PCDWALFILES THEN
  659.     ListSym$ = PCDWALNEEDS$
  660.     END IF
  661.  
  662.     StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
  663.  
  664.     cost& = 0
  665.     FOR i% = 1 TO 26 STEP 1
  666.     cost&  = cost& + VAL(GetListItem(ListSym$, i%))
  667.     NEXT i%
  668.     ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
  669.  
  670.     IF StillNeed& > 0 THEN
  671.     ReplaceListItem BIGLIST$, ftype%, "YES"
  672.     ELSE
  673.     ReplaceListItem BIGLIST$, ftype%, ""
  674.     END IF
  675.  
  676. '    IF fExtra% THEN
  677. '        ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
  678. '    END IF
  679.     RestoreCursor CursorSave%
  680.     ListSym$ = ""
  681. END SUB
  682.  
  683.  
  684. '**
  685. '** Purpose:
  686. '**     Recalculates disk space and sets option status info according
  687. '**     to the current destination path.
  688. '** Arguments:
  689. '**     none.
  690. '** Returns:
  691. '**     none.
  692. '*************************************************************************
  693. SUB RecalcPath STATIC
  694.  
  695.     CursorSave% = ShowWaitCursor()
  696.  
  697.     RecalcOptFiles PCDLABFILES
  698.     RecalcOptFiles PCDMOSFILES
  699.     RecalcOptFiles PCDAUDFILES
  700.     RecalcOptFiles PCDSCRFILES
  701.     RecalcOptFiles PCDWALFILES
  702.  
  703.     RestoreCursor CursorSave%
  704. END SUB
  705.  
  706.  
  707. '**
  708. '** Purpose:
  709. '**     Sets drive status info according to latest disk space calcs.
  710. '** Arguments:
  711. '**     none.
  712. '** Returns:
  713. '**     none.
  714. '*************************************************************************
  715. SUB SetDriveStatus STATIC
  716.  
  717.     drive$ = MID$(DEST$, 1, 1)
  718.     ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  719.     cost& = VAL(GetListItem(PCDLABNEEDS$, ndrive%)) + VAL(GetListItem(PCDMOSNEEDS$, ndrive%)) + VAL(GetListItem(PCDAUDNEEDS$, ndrive%)) + VAL(GetListItem(PCDSCRNEEDS$, ndrive%)) + VAL(GetListItem(PCDWALNEEDS$, ndrive%))
  720.     free& = GetFreeSpaceForDrive(drive$)
  721.     ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
  722.     ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
  723.     ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
  724.  
  725.     IF drive$ = WINDRIVE$ THEN
  726.     ReplaceListItem DRIVETEXT$, 4, ""
  727.     ReplaceListItem DRIVETEXT$, 5, ""
  728.     ReplaceListItem DRIVETEXT$, 6, ""
  729.     ELSE
  730.     ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  731.     cost& = VAL(GetListItem(PCDLABNEEDS$, ndrive%)) + VAL(GetListItem(PCDMOSNEEDS$, ndrive%)) + VAL(GetListItem(PCDAUDNEEDS$, ndrive%)) + VAL(GetListItem(PCDSCRNEEDS$, ndrive%)) + VAL(GetListItem(PCDWALNEEDS$, ndrive%))
  732.     IF cost& = 0 THEN
  733.         ReplaceListItem DRIVETEXT$, 4, ""
  734.         ReplaceListItem DRIVETEXT$, 5, ""
  735.         ReplaceListItem DRIVETEXT$, 6, ""
  736.     ELSE
  737.         free& = GetFreeSpaceForDrive(WINDRIVE$)
  738.         ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":"
  739.         ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K"
  740.         ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
  741.     END IF
  742.     END IF
  743. END SUB
  744.  
  745.  
  746. '**
  747. '** Purpose:
  748. '**     Appends a file name to the end of a directory path,
  749. '**     inserting a backslash character as needed.
  750. '** Arguments:
  751. '**     szDir$  - full directory path (with optional ending "\")
  752. '**     szFile$ - filename to append to directory
  753. '** Returns:
  754. '**     Resulting fully qualified path name.
  755. '*************************************************************************
  756. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  757.     IF szDir$ = "" THEN
  758.     MakePath = szFile$
  759.     ELSEIF szFile$ = "" THEN
  760.     MakePath = szDir$
  761.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  762.     MakePath = szDir$ + szFile$
  763.     ELSE
  764.     MakePath = szDir$ + "\" + szFile$
  765.     END IF
  766. END FUNCTION
  767.  
  768.